package me.ywy.kotlinvideo.ui.activity

import android.content.Intent
import android.support.v4.view.ViewCompat
import android.support.v4.view.ViewPropertyAnimatorListener
import android.view.View
import kotlinx.android.synthetic.main.activity_splash.*
import me.ywy.kotlinvideo.R
import me.ywy.kotlinvideo.base.BaseActivity
import org.jetbrains.anko.startActivity

/**
 * Created by ywy on 2018-11-01.
 */
class SplashActivity :BaseActivity(), ViewPropertyAnimatorListener {
    override fun onAnimationEnd(view: View?) {
        startActivityAndFinishThis<MainActivity>()
    }

    override fun onAnimationCancel(view: View?) {
    }

    override fun onAnimationStart(view: View?) {
    }

    override fun getLayoutId(): Int {
        return R.layout.activity_splash
    }

    override fun initView() {
        ViewCompat.animate(splash_iv)
                .scaleX(1.0f)
                .scaleY(1.0f)
                .setDuration(1000)
                .setListener(this)
                .start()
    }
}